﻿using System;

namespace 多线程2
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Action<string> action = Test;

            AsyncCallback callback = cb =>
            {
                Console.WriteLine(cb.AsyncState);
            };
            action.BeginInvoke("我要执行了", callback, "执行完了");

          


            Func<int, bool> func = Test;

            AsyncCallback asyncCallback = cb =>
            {
                Console.WriteLine($"{cb.AsyncState}");
                Console.WriteLine($"执行完成了{cb.IsCompleted}");
            };
            func.BeginInvoke(12345, asyncCallback,"一个执行信号");



            Console.ReadKey();
        }

        static bool Test(int t)
        {
            Console.WriteLine("收到参数了");
            return false;
        }

        static void Test(string str)
        {
            Console.WriteLine(str);
        }


    }
}
